package it.getta.vicinometro.popup;

import com.google.android.maps.GeoPoint;

import it.getta.vicinometro.ActivityCallBack;
import it.getta.vicinometro.R;
import android.content.Context;
import android.util.Log;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.LinearLayout;

public class OptionsPopup extends VicinometroPopup {
	
	private GeoPoint mPoint;

	public OptionsPopup(Context context, ActivityCallBack activityCallBack, GeoPoint point) {
		super(context, activityCallBack, R.layout.choose_mode_pupup);
		mPoint = point;
	}
	
	@Override
	public void showPopup() {
		super.showPopup();
		LinearLayout choose1 = (LinearLayout)mPopupRootView.findViewById(R.id.choose1);
		choose1.setOnClickListener(new OnClickListener() {
			
			@Override
			public void onClick(View v) {
				Log.d("TAG", "onClick");
				dismiss();
				mActivityCallBack.showSetAlarmPopup(mPoint);
			}
		});
		
		LinearLayout choose2 = (LinearLayout)mPopupRootView.findViewById(R.id.choose2);
		choose2.setOnClickListener(new OnClickListener() {
			
			@Override
			public void onClick(View v) {
				Log.d("TAG", "onClick");
				dismiss();
//				ChooseFromListPopup popup = new ChooseFromListPopup(mContext, R.layout.choose_from_list_popup, mPoint);
//				popup.show(popupRootView);
				mActivityCallBack.showListPopup(mPoint);
				
			}
		});
		
		show(mActivityCallBack.getPopupAnchor());
		
	}

	
}
